<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="UTF-8">
		<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no" name="viewport">
		<title>用户后台管理</title>

		<link rel="stylesheet" href="u-admin/dist/modules/bootstrap/css/bootstrap.min.css">
		<link rel="stylesheet" href="u-admin/dist/modules/ionicons/css/ionicons.min.css">
		<link rel="stylesheet" href="u-admin/dist/modules/fontawesome/web-fonts-with-css/css/fontawesome-all.min.css">

		<link rel="stylesheet" href="u-admin/dist/modules/summernote/summernote-lite.css">
		<link rel="stylesheet" href="u-admin/dist/modules/flag-icon-css/css/flag-icon.min.css">
		<link rel="stylesheet" href="u-admin/dist/css/demo.css">
		<link rel="stylesheet" href="u-admin/dist/css/style.css">
		<link rel="stylesheet" type="text/css" href="css/zxf_page.css"/>
	</head>

	<body>
		<div id="app">
			<div class="main-wrapper">
				<div class="navbar-bg"></div>
				<div th:replace="commons/u-admin-bar::#navbar"></div>
				<div th:replace="commons/u-admin-bar::#sidebar(currUri='trash-articles')"></div>
				<div class="main-content">
					<section class="section">
						<h1 class="section-header">
							<div><i class="icon ion-ios-trash"></i> 回收站</div>
						</h1>
							<div class="col-12">
								<div class="card">
									<div class="card-header">
										<p>
											<a href="all-published-articles?current=1">已发布</a>（ [[${statistics.published}]] ） |
											<a href="all-draft-articles?current=1">草稿</a>（ [[${statistics.draft}]] ） | <a href="all-trash-articles?current=1">回收站</a>（ [[${statistics.trash}]] ）
										</p>
									</div>
									<div class="card-body">
										<div class="table-responsive">
											<h5 th:if="${articles.size()==0}">回收站空空的，快去<a href="publish-article">发表</a>一篇吧！</h5>
											<table class="table table-striped" th:if="${articles.size()!=0}">
												<thead>
												<tr>
													<th style="width: 26%">题目</th>
													<th style="width: 15%">分类目录</th>
													<th style="width: 15%">标签</th>
													<th style="width: 7%">点赞数</th>
													<th style="width: 7%">评论数</th>
													<th style="width: 10%">日期</th>
													<th style="width: 10%">阅读</th>
													<th style="width: 10%">状态</th>
												</tr>
												</thead>
												<tbody>

												<tr th:each="a:${articles}" style="font-weight: 300">
													<td>
														[[${a.article.getArticleTitle()}]]
														<div class="table-links">
															<div class="bullet"></div>
															<a th:href="@{/read-article(uId=${a.article.userId},uName=${a.author.userName},aId=${a.article.articleId},title=${a.article.articleTitle})}">查看 | </a>
															<a th:href="@{/edit-article(articleId=${a.article.articleId})}" >编辑 | </a>
															<a th:href="@{/re-publish-article(articleId=${a.article.articleId})}" th:if="${a.article.getArticleStatus() == 0 and a.article.secret == true}" href="#">公开 |</a>
															<a th:href="@{/re-publish-private-article(articleId=${a.article.articleId})}" th:if="${a.article.secret == false} " href="#">私密 |</a>
															<a th:href="@{/re-publish-article(articleId=${a.article.articleId})}" th:if="${a.article.getArticleStatus() != 0}" href="#">发布 |</a>
															<a th:href="@{/delete-article(articleId=${a.article.articleId})}" th:if="${a.article.getArticleStatus() != 2}" href="#" style="color: red">移入回收站</a>
															<a th:href="@{/completely-delete-article(articleId=${a.article.articleId})}" th:if="${a.article.getArticleStatus() == 2}" href="#" style="color: red">删除 </a>
														</div>
													</td>
													<td th:text="${a.article.getArticleKinds()}"></td>
													<td th:text="${a.article.getArticleTags()}"></td>
													<td th:text="${a.getLikeCount()}"></td>
													<td th:text="${a.getCommentCount()}"></td>
													<td th:text="${#dates.format(a.article.getPublishTime(),'yyyy-MM-dd HH:mm')}">1999-07-29</td>
													<td th:text="${a.article.getReadCount()}">0</td>
													<td th:if="${a.article.getArticleStatus() == 0}" th:text="发布"></td>
													<td th:if="${a.article.getArticleStatus() == 1}" th:text="草稿"></td>
													<td th:if="${a.article.getArticleStatus() == 2}" th:text="回收站"></td>
												</tr>

												</tbody>
											</table>
										</div>
									</div>
								</div>
							</div>
						<div class="col12" th:if="${articles.size()!=0}">
							<div class="zxf_pagediv"></div>
						</div>
						<div id="pageNum" style="display: none">[[${page.getPages()}]]</div>
						<div id="current" style="display: none">[[${page.getPageNum()}]]</div>

						<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
						<script type="text/javascript" src="js/zxf_page.js"></script>
						<script type="text/javascript">
							//翻页
							$(".zxf_pagediv").createPage({
								pageNum: $('#pageNum').html(),
								current: $('#current').html(),
								backfun: function(e) {
									var location = window.location.href;
									let strings = location.split("molihub");
									console.log(strings[0]);
									window.location.href = strings[0]+"molihub/all-trash-articles?current="+e['current'];
								}
							});
						</script>
					</section>
				</div>
				<div th:replace="commons/u-admin-bar::#footer"></div>
			</div>
		</div>

		<script src="u-admin/dist/modules/jquery.min.js"></script>
		<script src="u-admin/dist/modules/popper.js"></script>
		<script src="u-admin/dist/modules/tooltip.js"></script>
		<script src="u-admin/dist/modules/bootstrap/js/bootstrap.min.js"></script>
		<script src="u-admin/dist/modules/nicescroll/jquery.nicescroll.min.js"></script>
		<script src="u-admin/dist/modules/scroll-up-bar/dist/scroll-up-bar.min.js"></script>
		<script src="u-admin/dist/js/sa-functions.js"></script>

		<script src="u-admin/dist/modules/chart.min.js"></script>
		<script src="u-admin/dist/modules/summernote/summernote-lite.js"></script>
		
		<script src="u-admin/dist/js/scripts.js"></script>
		<script src="u-admin/dist/js/custom.js"></script>
		<script src="u-admin/dist/js/demo.js"></script>
	</body>
</html>
